package com.gill.touka.controller;

import com.gill.touka.auth.CheckAuthorize;
import com.gill.touka.domain.dto.AuditDTO;
import com.gill.touka.domain.dto.ShareDTO;
import com.gill.touka.domain.entity.Share;
import com.gill.touka.service.ShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 管理员相关接口
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private ShareService shareService;

    @CheckAuthorize(role = "admin")
    @PutMapping("/shares/audit/{id}")
    public Share auditById(@PathVariable("id") Integer id, @RequestBody AuditDTO auditDTO){
        return shareService.auditById(id,auditDTO);
    }

}
